import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'

// 配置绝对路径别名@
import path from 'path'

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      imports: ['vue'], // 自动导入 Vue 相关函数，如：ref, reactive, toRef 等
    }),
  ],

  resolve: {
    alias: {
      // 配置绝对路径别名@
      '@': path.resolve(__dirname, 'src'),
      'art-template': 'art-template/lib/template-web.js',
      'dot': 'dot/doT.js',
    },
  },

  css: {
    preprocessorOptions: {
      scss: {
        // The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0
        api: 'modern'
      }
    }
  },
})
